using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Communication_EnvelopeType_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Communication.EnvelopeType);

            field = type.GetField("Mate", flag);
            app.RegisterCLRFieldGetter(field, get_Mate_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Mate_0, null);
            field = type.GetField("AesMate", flag);
            app.RegisterCLRFieldGetter(field, get_AesMate_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_AesMate_1, null);
            field = type.GetField("Json", flag);
            app.RegisterCLRFieldGetter(field, get_Json_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_Json_2, null);
            field = type.GetField("AesJson", flag);
            app.RegisterCLRFieldGetter(field, get_AesJson_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_AesJson_3, null);
            field = type.GetField("DataBuffer", flag);
            app.RegisterCLRFieldGetter(field, get_DataBuffer_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_DataBuffer_4, null);
            field = type.GetField("AesDataBuffer", flag);
            app.RegisterCLRFieldGetter(field, get_AesDataBuffer_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_AesDataBuffer_5, null);
            field = type.GetField("String", flag);
            app.RegisterCLRFieldGetter(field, get_String_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_String_6, null);
            field = type.GetField("AesString", flag);
            app.RegisterCLRFieldGetter(field, get_AesString_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_AesString_7, null);
            field = type.GetField("ProtoBuf", flag);
            app.RegisterCLRFieldGetter(field, get_ProtoBuf_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_ProtoBuf_8, null);
            field = type.GetField("Lz4AesJson", flag);
            app.RegisterCLRFieldGetter(field, get_Lz4AesJson_9);
            app.RegisterCLRFieldBinding(field, CopyToStack_Lz4AesJson_9, null);
            field = type.GetField("Success", flag);
            app.RegisterCLRFieldGetter(field, get_Success_10);
            app.RegisterCLRFieldBinding(field, CopyToStack_Success_10, null);
            field = type.GetField("Failed", flag);
            app.RegisterCLRFieldGetter(field, get_Failed_11);
            app.RegisterCLRFieldBinding(field, CopyToStack_Failed_11, null);
            field = type.GetField("Heart", flag);
            app.RegisterCLRFieldGetter(field, get_Heart_12);
            app.RegisterCLRFieldBinding(field, CopyToStack_Heart_12, null);
            field = type.GetField("File", flag);
            app.RegisterCLRFieldGetter(field, get_File_13);
            app.RegisterCLRFieldBinding(field, CopyToStack_File_13, null);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Communication.EnvelopeType());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Communication.EnvelopeType[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }



        static object get_Mate_0(ref object o)
        {
            return huqiang.Communication.EnvelopeType.Mate;
        }

        static StackObject* CopyToStack_Mate_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.Mate;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_AesMate_1(ref object o)
        {
            return huqiang.Communication.EnvelopeType.AesMate;
        }

        static StackObject* CopyToStack_AesMate_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.AesMate;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_Json_2(ref object o)
        {
            return huqiang.Communication.EnvelopeType.Json;
        }

        static StackObject* CopyToStack_Json_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.Json;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_AesJson_3(ref object o)
        {
            return huqiang.Communication.EnvelopeType.AesJson;
        }

        static StackObject* CopyToStack_AesJson_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.AesJson;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_DataBuffer_4(ref object o)
        {
            return huqiang.Communication.EnvelopeType.DataBuffer;
        }

        static StackObject* CopyToStack_DataBuffer_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.DataBuffer;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_AesDataBuffer_5(ref object o)
        {
            return huqiang.Communication.EnvelopeType.AesDataBuffer;
        }

        static StackObject* CopyToStack_AesDataBuffer_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.AesDataBuffer;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_String_6(ref object o)
        {
            return huqiang.Communication.EnvelopeType.String;
        }

        static StackObject* CopyToStack_String_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.String;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_AesString_7(ref object o)
        {
            return huqiang.Communication.EnvelopeType.AesString;
        }

        static StackObject* CopyToStack_AesString_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.AesString;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_ProtoBuf_8(ref object o)
        {
            return huqiang.Communication.EnvelopeType.ProtoBuf;
        }

        static StackObject* CopyToStack_ProtoBuf_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.ProtoBuf;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_Lz4AesJson_9(ref object o)
        {
            return huqiang.Communication.EnvelopeType.Lz4AesJson;
        }

        static StackObject* CopyToStack_Lz4AesJson_9(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.Lz4AesJson;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_Success_10(ref object o)
        {
            return huqiang.Communication.EnvelopeType.Success;
        }

        static StackObject* CopyToStack_Success_10(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.Success;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_Failed_11(ref object o)
        {
            return huqiang.Communication.EnvelopeType.Failed;
        }

        static StackObject* CopyToStack_Failed_11(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.Failed;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_Heart_12(ref object o)
        {
            return huqiang.Communication.EnvelopeType.Heart;
        }

        static StackObject* CopyToStack_Heart_12(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.Heart;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static object get_File_13(ref object o)
        {
            return huqiang.Communication.EnvelopeType.File;
        }

        static StackObject* CopyToStack_File_13(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.EnvelopeType.File;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Communication.EnvelopeType();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
